﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CamServer
{
    public partial class Preferences : DavuxLib.Controls.AeroForm
    {

        DavuxLib.SettingsUI sui = new DavuxLib.SettingsUI();

        public Preferences()
        {
            InitializeComponent();
            _GlassArea.Bottom = ClientRectangle.Height - btnApply.Location.Y + 2;
            sui.LoadControlData(Controls);
        }


        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);
            Invalidate();
        }

        private void btnApply_Click(object sender, EventArgs e)
        {
            sui.SaveControlData(Controls);
            Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked)
            {
                textBox2.Enabled = true;
                textBox3.Enabled = true;
                textBox4.Enabled = true;
                textBox7.Enabled = true;
            }
            else
            {
                textBox2.Enabled = false;
                textBox3.Enabled = false;
                textBox4.Enabled = false;
                textBox7.Enabled = false;
            }
        }
    }
}
